Skip to content

Update the docker build process#142

Merged
joe-braley merged 9 commits intomainfrom
joe/enhancements
Feb 18, 2026
Merged

Update the docker build process#142
joe-braley merged 9 commits intomainfrom
joe/enhancements

Conversation

@joe-braley
Copy link
Contributor

This change request alters how the Java Engineering Group builds its OpenJDK docker images. With the intent that the process is more consistent and robust.

  • Reduce the default parameters. We did not need to define so many platforms as defaults.
  • Properly pass arguments to scripts as arguments and not as environment variables.
  • Annotates previous images as EOL by sha256 hash and not by tag reference.
  • Adds dry-run functionality so changes can be tested and commands logged for reviewablilty.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Azure DevOps pipeline + helper scripts used by the Java Engineering Group to build/push OpenJDK container images, and to annotate previous images as EOL by digest, with added dry-run support for safer validation.

Changes:

  • Refactors build-image.sh to accept CLI arguments (instead of env vars), adds dry-run logging, and emits the built image digest via --metadata-file.
  • Replaces tag-based “previous image” annotation with digest-based annotation using new pipeline templates.
  • Updates .devops/build.yml to use the new templates, introduces dryrun and az_package parameters, and adjusts signing to use a container digest reference.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
scripts/image-annotation.sh Switches from docker-pull/inspect to digest-based ORAS lifecycle annotation; adds dry-run mode and CLI args.
scripts/build-image.sh Reworks argument passing, adds dry-run behavior, records container digest from build metadata.
.devops/templates/prepare-annotation.yml New template to fetch a manifest and extract amd64/arm64 digests into pipeline variables.
.devops/templates/annotate-image.yml New template to install ORAS and annotate prior amd64/arm64 digests, with optional dry-run.
.devops/build.yml Pipeline refactor to use new templates/args, reduce defaults, and sign by digest reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +25
while getopts "r:m:d" opt; do
case $opt in
r)
registry="$OPTARG"
;;
m)
manifest="$OPTARG"
;;
d)
debug=true
;;
*)
echo "Invalid option: -$OPTARG"
exit 1
;;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
while getopts "r:m:d" opt; do
case $opt in
r)
registry="$OPTARG"
;;
m)
manifest="$OPTARG"
;;
d)
debug=true
;;
*)
echo "Invalid option: -$OPTARG"
exit 1
;;
while test $# -gt 0; do
case "$1" in
-r|--registry)
shift
registry="$1"
;;
-m|--manifest)
shift
manifest="$1"
;;
-d|--debug)
shift
debug=true
;;
*)
echo "Invalid option: $1"
exit 1
;;

Is it cool if we add full-word options for flags? This suggestion is how I know to do it, but I am fine with any implementation if it achieves the same effect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getopts does not support long versions of arguments. I'll have to switch to a different method.

Comment on lines +40 to +46
-r ${{ parameters.registry }}
-m $(imageDigestAmd64)
-d
${{ else }}:
arguments: >
-r ${{ parameters.registry }}
-m $(imageDigestAmd64)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-r ${{ parameters.registry }}
-m $(imageDigestAmd64)
-d
${{ else }}:
arguments: >
-r ${{ parameters.registry }}
-m $(imageDigestAmd64)
--registry ${{ parameters.registry }}
--manifest $(imageDigestAmd64)
--debug
${{ else }}:
arguments: >
--registry ${{ parameters.registry }}
--manifest $(imageDigestAmd64)

If you implement my suggestion below, I would prefer this (to make the code more clear to future devs)

Comment on lines +57 to +64
arguments: >
-r ${{ parameters.registry }}
-m $(imageDigestArm64)
-d
${{ else }}:
arguments: >
-r ${{ parameters.registry }}
-m $(imageDigestArm64) No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
arguments: >
-r ${{ parameters.registry }}
-m $(imageDigestArm64)
-d
${{ else }}:
arguments: >
-r ${{ parameters.registry }}
-m $(imageDigestArm64)
arguments: >
--registry ${{ parameters.registry }}
--manifest $(imageDigestArm64)
--debug
${{ else }}:
arguments: >
--registry ${{ parameters.registry }}
--manifest $(imageDigestArm64)

Same here

@jmjaffe37
Copy link
Contributor

PR LGTM! I will approve once my formatting suggestions are addressed :)

Copy link
Contributor

@jmjaffe37 jmjaffe37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@joe-braley joe-braley merged commit 9418d83 into main Feb 18, 2026
19 checks passed
@joe-braley joe-braley deleted the joe/enhancements branch February 18, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants